class CreateUsers < ActiveRecord::Migration
  def self.up
    create_table :users do |t|
      t.column :login, :string
      t.column :password_encrypted, :string
      t.column :salt, :string
      t.column :activation_code, :string

      t.column :first_name, :string
      t.column :last_name, :string

      t.text :description

      t.column :email, :string
      t.column :email_confirmed, :boolean, :default => false

      t.column :active, :boolean, :default => true

      t.column :visit_count, :integer, :default => 0

      t.datetime :last_login, :remember_login

      t.column :session_id, :string

      t.timestamps
    end
   
    add_column :ideas, :user_id, :integer
  end

  def self.down
    drop_table :users
   
    remove_column :ideas, :user_id, :integer
  end
end
